package com.zkw.group.service;

import com.zkw.group.entity.ProfesTerm;
import com.zkw.group.mapper.ProfesTermMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProfesTermService {

    @Autowired
    private ProfesTermMapper profesTermMapper;

    //获取学期列表
    public List<ProfesTerm> getAllProfesTermList(String termname, int pageStart, int pageSize){
        return profesTermMapper.getAllProfesTermList(termname, pageStart, pageSize);
    }

    //获取学期条目数
    public int getProfesTermCounts(String termname){
        return  profesTermMapper.getProfesTermCounts(termname);
    }

    //添加学期
    public int addProfesTerm(ProfesTerm profesTerm){
        return profesTermMapper.addProfesTerm(profesTerm);
    }

    //删除指定学期
    public int deleteProfesTerm(String termname){
        return profesTermMapper.deleteProfesTerm(termname);
    }

    //获取要更新的学期信息以及更新指定学期信息
    public ProfesTerm getUpdateProfesTerm(String termname){
        return profesTermMapper.getUpdateProfesTerm(termname);
    }

    public int updateProfesTerm(ProfesTerm profesTerm){
        return profesTermMapper.updateProfesTerm(profesTerm);
    }
}
